<table cellspacing="0" class="sf_admin_list">

	<thead>
		<tr><?php include_partial('list_th_tabular', array('nhac' => $nhac, 'duyet' => $duyet)) ?></tr>
	</thead>
	
	<tbody>
	<?php echo form_tag('ringtone/vmsApproveAll', 'class=simpleForm name=vms_approve_form') ?>
		<?php $i = 1; foreach ($pager->getResults() as $ringtone): $odd = fmod(++$i, 2) ?>
		
			<tr class="sf_admin_row_<?php echo $odd ?>">
				<?php include_partial('list_td_tabular', array('ringtone' => $ringtone, 'nhac' => $nhac, 'duyet' => $duyet)) ?>
				<?php //include_partial('list_td_actions', array('ringtone' => $ringtone)) ?>
			</tr>
			
		<?php endforeach; ?>
		<?php if ($nhac == 'chuong' && $duyet == 'vmschuaduyet'): ?>
		<tr>
			<div style="display: block; height: auto; overflow: hidden; width: 100%;">
				<input style="width:140px; float: right;"  type="submit" name="submit" value="Duyệt Nhiều" />
			</div>
		</tr>
		<?php endif;?>
	</tbody>
	<tfoot>
		<tr>
			<th colspan="8">
				<div class="float-right">
				
					<?php if ($pager->haveToPaginate()): ?>
						  <?php echo link_to(image_tag(sfConfig::get('sf_admin_web_dir').'/images/first.png', array('align' => 'absmiddle', 'alt' => __('First'), 'title' => __('First'))), $uri . 'page=1') ?>
						  
						  <?php echo link_to(image_tag(sfConfig::get('sf_admin_web_dir').'/images/previous.png', array('align' => 'absmiddle', 'alt' => __('Previous'), 'title' => __('Previous'))), $uri . 'page='.$pager->getPreviousPage()) ?>
						
						  <?php foreach ($pager->getLinks() as $page): ?>
							    <?php echo link_to_unless($page == $pager->getPage(), $page, $uri . 'page='.$page) ?>
						  <?php endforeach; ?>
						
						  <?php echo link_to(image_tag(sfConfig::get('sf_admin_web_dir').'/images/next.png', array('align' => 'absmiddle', 'alt' => __('Next'), 'title' => __('Next'))), $uri . 'page='.$pager->getNextPage()) ?>
						  
						  <?php echo link_to(image_tag(sfConfig::get('sf_admin_web_dir').'/images/last.png', array('align' => 'absmiddle', 'alt' => __('Last'), 'title' => __('Last'))), $uri . 'page='.$pager->getLastPage()) ?>
						  
					<?php endif; ?>
					
				</div>
				
				<?php echo format_number_choice('[0] no result|[1] 1 result|(1,+Inf] %1% results', array('%1%' => $pager->getNbResults()), $pager->getNbResults()) ?>
				
			</th>
		</tr>
	</tfoot>
	
</table>

<script language="JavaScript">

function CheckAll(form_name,fied_name)
{
	if(!document.forms[form_name])
		return;
	var objCheckBoxes = document.forms[form_name].elements[fied_name];
	if(!objCheckBoxes)
		return;
	var countCheckBoxes = objCheckBoxes.length;
	if(!countCheckBoxes)
		objCheckBoxes.checked = !objCheckBoxes.checked;
	else
		// set the check value for all check boxes
		for(var i = 0; i < countCheckBoxes; i++)
			objCheckBoxes[i].checked = !objCheckBoxes[i].checked;

}

</script>
